package main.model;

import java.util.ArrayList;
import java.util.HashMap;

import y.base.EdgeList;

/**
 * bean holds the candidate Steiner tree G and the conditional probability Pr(G|F)
 * 
 * @author YuanAn
 *
 */
public class MappingCandidate implements Comparable<MappingCandidate>{

	private EdgeList g;//the candidate Steiner tree
	
	private double prob;//the conditional probability given the form tree
	
	HashMap<ArrayList<String>, OntoPath> pairToPaths; //mappings from a pair of node labels to a path for the steiner
	
	public MappingCandidate(EdgeList g){
		
		this.g = g;
		prob = -10000.0;
		pairToPaths = null;
	}
	
	//getter and setter
	
	public EdgeList getCandidateSteinerTree(){
		return g;
	}
	
	public void setProbability(double p){
		prob = p;
	}
	
	public double getProbability(){
		return prob;
	}
	
	public void setPairToPaths(HashMap<ArrayList<String>, OntoPath> p2p){
		pairToPaths = p2p;
	}
	
	public HashMap<ArrayList<String>, OntoPath> getPairToPaths(){
		return pairToPaths;
	}
	
	public int compareTo(MappingCandidate other){
		
		if(prob > other.getProbability())
			return -1;
		
		else
			return 1;
	}
}
